import {checkAndGoBack} from "../containers/best-line-up/best-line-up";

export const goBack = (history, toUrl, backCount,) => {
    if (window.plus && window.plus.webview) {
        const w = window.plus.webview.currentWebview()
        w.canBack((e) => {
            w.back()
        })
    } else {
        if (toUrl) {
            window.location = toUrl
            // checkAndGoBack(history, toUrl)
        } else {
            if (backCount) {
                history.go(backCount)
            } else {
                history.goBack()
            }
        }

    }
}
